zephyr: remove k_thread_cpu_mask_clear() calls#11002
Closed
serhiy-katsyuba-intel wants to merge 1 commit into
Closed
zephyr: remove k_thread_cpu_mask_clear() calls#11002serhiy-katsyuba-intel wants to merge 1 commit into
serhiy-katsyuba-intel wants to merge 1 commit into
Conversation
When CONFIG_SCHED_CPU_MASK_PIN_ONLY is enabled, an empty CPU mask is not allowed. Calling k_thread_cpu_mask_clear() triggers an assertion, which causes firmware boot failure when CONFIG_ASSERT is enabled. Use k_thread_cpu_pin() instead. Signed-off-by: Serhiy Katsyuba <serhiy.katsyuba@intel.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR prevents Zephyr boot-time assertions when CONFIG_SCHED_CPU_MASK_PIN_ONLY is enabled by removing k_thread_cpu_mask_clear() (which can produce an invalid empty CPU mask) and replacing the previous “clear + enable one CPU” sequence with k_thread_cpu_pin() to bind threads to a specific core.
Changes:
- Pin the EDF workqueue thread to
PLATFORM_PRIMARY_CORE_IDusingk_thread_cpu_pin(). - Pin low-latency (LL) domain threads to their target core using
k_thread_cpu_pin(). - Pin DMA domain threads to their target core using
k_thread_cpu_pin().
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| zephyr/edf_schedule.c | Pins the EDF workqueue thread to the primary core without clearing the CPU mask. |
| src/schedule/zephyr_domain.c | Pins LL domain threads to the selected core using k_thread_cpu_pin(). |
| src/schedule/zephyr_dma_domain.c | Pins DMA domain thread to the selected core using k_thread_cpu_pin(). |
Collaborator
|
@serhiy-katsyuba-intel I think this is a duplicate of #10953 . We should get one of these in though. |
lyakh
approved these changes
Jul 16, 2026
Contributor
Author
|
Closed in favor of #10953 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When CONFIG_SCHED_CPU_MASK_PIN_ONLY is enabled, an empty CPU mask is not allowed. Calling k_thread_cpu_mask_clear() triggers an assertion, which causes firmware boot failure when CONFIG_ASSERT is enabled.
Use k_thread_cpu_pin() instead.